<script>
import axios from "axios";

export default {
  name: "Child",
  data() {
    return {
      dataList: []
    }
  }, mounted() {
    axios.get("data.json")
        .then(res => {
          this.dataList = res.data
        }).catch(err => {
      console.log(err)
    })
  }
}
</script>

<template>
  <div>
  <!-- mylist  a 都是可以随意定义，向父组件暴露  -->
    <slot :mylist="dataList" a="测试插槽">
      <ul>
        <li v-for="data in dataList" :key="data.id">
          {{data.showName}}
        </li>
      </ul>
    </slot>
  </div>

</template>

<style scoped>

</style>